package nowcoder;

import java.util.Scanner;

public class 兔子总数 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        while (scan.hasNextInt()) {
            int month = scan.nextInt();
            System.out.println(compute(month));
        }
    }

    public static int compute(int month) {
        int n1 = 1;
        int n2 = 0;
        int n3 = 0;

        for (int i = 2; i <= month; i++) {
            n3 += n2;
            n2 = n1;
            n1 = n3;
        }
        return n1 + n2 + n3;
    }
}
